package com.example.online.music.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.online.music.common.R;
import com.example.online.music.model.domain.Consumer;
import com.example.online.music.model.request.ConsumerRequest;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface ConsumerService extends IService<Consumer> {

    R addUser(ConsumerRequest registryRequest);

    R updateUserMsg(ConsumerRequest updateRequest);

    R updateUserAvator(MultipartFile avatorFile, int id);

    R updatePassword(ConsumerRequest updatePasswordRequest);

    boolean existUser(String username);

    /**
     * 验证注册或登录时 手机号是否存在
     * @param phoneNum
     */
    boolean existUserByPhone(String phoneNum);

    boolean verityPasswd(String username, String password);

    R deleteUser(Integer id);

    R allUser();

    R userOfId(Integer id);

    R loginStatus(ConsumerRequest loginRequest, HttpSession session);

    List<Integer> getAllUserIds();

    boolean existUserByEmail(String recipientEmail);

    Consumer getOneByUserName(String username);

    boolean insert(Consumer consumer);
}
